header {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 6px 5px 4px 3px;
    box-sizing: border-box;
    background-color: #f3f3f3;
    .search {
        display: flex;
        flex: 1;
        .logo {
            width: 40px;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            i[class^='fa'] {
                font-size: 25px;
                color: #f39c12;
            }
        }
        .searchbox {
            display: flex;
            flex: 1;
            border: solid 1px #ddd;
            font-size: 17px;
            color: #aaa;
            align-items: center;
            & > div.icon {
                width: 30px;
                padding-left: 10px;
                display: flex;
                align-items: center;
            }
        }
        .user {
            width: 30px;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding-left: 15px;
            i[class^='fa'] {
                font-size: 20px;
                color: #aaa;
            }
        }
    }

    .menu {
        position: relative;
        padding: 10px;
        border-top: 15px;

        #toggle:checked {
            & + label {
                transform: rotateZ(180deg);
            }
            & ~ .category {
                display: block;
            }
            & ~ nav {
                display: none;
            }
        }
        label[for='toggle'] {
            transition: 1s;
            position: absolute;
            top: 12px;
            right: 0;
            color: #999;
            i {
                font-size: 15px;
            }
        }

        .category {
            color: #aaa;
            background-color: #f3f3f3;
            display: none;

            h2 {
                font-size: 16px;
                margin-bottom: 10px;
            }
            ul {
                display: flex;
                flex-wrap: wrap;
                li {
                    width: 25%; //border-box
                    padding-right: 10px; //综上 不能使用margin-right
                    margin-bottom: 8px;
                    border-radius: 5px;
                    &:nth-child(4n) {
                        padding-right: 0;
                    }
                    a {
                        text-decoration: none;
                        color: #aaa;
                        background-color: white;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border: solid 1px #ddd;
                        border-radius: 5px;
                        padding: 3px 10px;
                        font-size: 14px;
                        color: #999;
                    }
                }
            }
        }
        nav {
            display: flex;
            align-items: center;
            position: relative;
            & > div {
                flex: 1;
                display: flex;
                // justify-content: space-between;

                a {
                    margin-right: 20px;
                    text-decoration: none;
                    color: #aaa;
                    &.active {
                        color: #f39c12;
                        position: relative;
                        &::after {
                            content: ' ';
                            display: block;
                            height: 2px;
                            width: 30px;
                            background: #f39c12;
                            position: absolute;
                        }
                    }
                }
            }
        }
    }
}
